package edu.sctu.xiangkun.day201506.day20150614.textone;

import java.io.*;

/**
 * Created by user21 on 2015/6/14.
 */
public class IOInputStream {
    public void fileInputString(){
        FileInputStream fileInputStream;
        FileOutputStream fileOutputStream;
        int count = 0;
        int countbyte = 0;
        try{
            fileInputStream = new FileInputStream(new File("D://Koala.jpg"));
            fileOutputStream = new FileOutputStream(new File("D://Koala1.jpg"));
            try{
               while((countbyte = fileInputStream.read()) != -1){
                   count += countbyte;
                   fileOutputStream.write(count);
               }
                System.out.println(count);
            }catch(IOException e){
                e.printStackTrace();
            }

            try{
                fileInputStream.close();
            }catch(IOException e){
                e.printStackTrace();
            }

        }catch(FileNotFoundException e){
            e.printStackTrace();
        }
    }
}
